package model

import (
	"time"

	. "gddgame.cc/galaxy/common/dsl/game/reward"
	. "gddgame.cc/galaxy/common/dsl/game/task"
)

const SettingTaskName = "setting_task"

// 战区任务 / 悬赏单任务 / 每日任务  设置
type TaskLogic struct {
	Boss      bool  `json:"boss"`
	Targets   []int `json:"targets"`
	Objects   []int `json:"objects"`
	MaxNumber int32 `json:"max_number"`
	MinNumber int32 `json:"min_number"`
	All       bool  `json:"all"`
}

type SettingTask struct {
	Id          int               `json:"id" orm:"auto" sql:"INT"`
	Name        map[string]string `json:"name" sql:"JSON"`
	Desc        map[string]string `json:"desc" sql:"JSON"`
	Type        TaskType          `json:"type" sql:"TINYINT"`
	Difficult   int               `json:"difficult" sql:"TINYINT"`
	Logic       TaskLogic         `json:"logic" sql:"JSON"`
	IsAddUp     bool              `json:"is_add_up" sql:"TINYINT"`
	SupportMode []GameMode        `json:"support_mode" sql:"JSON"`
	RewardType  RewardType        `json:"reward_type" sql:"TINYINT"`

	UpdateTime *time.Time `json:"update_time" orm:"updateTime" sql:"DATETIME"`
}
